const getFrontCodeStr = (tableName,keyName,allFields) => {
    const fieldsName = allFields.filter(item=>item!==keyName)
    console.log(fieldsName)
 return     "<template> \n" +
            "<div class='panel-root-dom' ref='domRef'> \n"+
            "   <a-spin :spinning='spinning'> \n" +
            "   <div class='panel-header'> \n" +
            "       <a-form style='background-color: #fff;padding-top: 10px;'> \n" +
            "           <a-row  style='height: 40px;'> \n" +
            "               <a-col :span='6'> \n"+
            "                   <a-form-item label='业务分类' :label-col='{ span: 8 }' \n"+
            "                       :wrapper-col='{ span: 16 }'> \n"+
            "                       <a-select \n"+
            "                           v-model:value='classificationCode' \n"+
            "                           style='width: 180px' allowClear \n"+
            "                           :options='workTypeCodeOption' \n"+
            "                           ></a-select> \n"+
            "                       </a-form-item> \n"+
            "               </a-col> \n"+
            "               <a-col :span='6'> \n"+
            "                   <a-form-item label='配置项名称' :label-col='{ span: 8 }' \n"+
            "                   :wrapper-col='{ span: 16 }'> \n"+
            "                       <a-input v-model:value='configurationName' style='width: 180px' allowClear></a-input> \n"+
            "                   </a-form-item> \n"+
            "               </a-col> \n"+
            "               <a-col :span='8'> \n"+
            "                   <a-button type='primary' :icon='h(SearchOutlined)' @click='initPageAndRefreshData'>查询</a-button> \n"+
            "               </a-col> \n"+
            "           </a-row> \n"+
            "       </a-form> \n"+
            "   </div> \n"+
            "   <div class='panel-body'> \n"+
            "       <div class='panel-body-content'> \n"+
            "           <a-table  :columns='columnsArray' :data-source='tableData' :scroll='{ x: columnsArray.length*120,y:fullHeight-100 }' bordered :pagination='false'> \n"+
            "               <template #bodyCell='{ column, record,index }'> \n"+
            "                   <template v-if='column.dataIndex === \"configurationValue\"'> \n"+
            "                       <a-radio-group v-if=\"record?.configurationName=='系统首页默认模式'\" v-model:value='record.configurationValue' @change='updateData(record,index)'> \n"+
            "                           <a-radio value='1'> 孪生模式</a-radio> \n"+
            "                           <a-radio value='2'> 经典模式</a-radio> \n"+
            "                           </a-radio-group> \n"+
            "                       <a-input v-else v-model:value='record.configurationValue' @change='updateData(record,index)' /> \n"+
            "                       </template> \n"+
            "               </template> \n"+
            "           </a-table> \n"+
            "       </div> \n"+
            "   </div> \n"+
            "   <div class='panel-bottom'> \n"+
            "       <a-row> \n"+
            "           <a-col span='24' style='text-align:right;background-color: #fff;height: 40px;' > \n"+
            "               <a-pagination style='float:right;margin-top:10px;margin-right:10px;' \n"+
            "                   v-model:current='pageNo' \n"+
            "                   v-model:page-size='pageSize' \n"+
            "                   :page-size-options='pageSizeOption' \n"+
            "                   :total='total' \n"+
            "                   show-size-changer \n"+
            "                   show-quick-jumper \n"+
            "                   @showSizeChange='onShowSizeChange' \n"+
            "                   @change='onShowSizeChange' \n"+
            "                   :show-total='(total, range) => `共 ${total} 条数据`' \n"+
            "                   size='small'> \n"+
            "               </a-pagination> \n"+
            "           </a-col> \n"+
            "       </a-row> \n"+
            "   </div> \n"+
            "</div> \n"+
            "</a-spin> \n"+
            "</div> \n"+
        "</template> \n"+
        "<script setup lang='ts'> \n"+
        "import { ref, onMounted,h } from 'vue' \n"+
        "import SearchOutlined from '@ant-design/icons-vue/es/icons/SearchOutlined'; \n"+
        "import { getDictItemsByCode } from '/@/utils/dict/index'; \n"+
        "import { defHttp } from '/@/utils/http/axios'; \n"+
        "import APagination from 'ant-design-vue/lib/pagination'; \n"+
        "const domRef = ref<HTMLDivElement | null>(null); \n"+
        "const fullHeight = ref(domRef.value?.clientHeight || 900)   //获取根节点自适应高度 \n"+
        "const workTypeCodeOption = ref(getDictItemsByCode('sys-info-work-type')) \n"+
        "const classificationCode = ref('') \n"+
        "const configurationName = ref('') \n"+
        "const pageSizeOption = ref(['10', '20', '30', '40', '50']) \n"+
        "const spinning = ref(false) \n"+
        "const tableData:any = ref([]) \n"+
        "const columnsArray:any = ref([{title: '业务分类',dataIndex: 'classification',key: 'classification',},{title: '配置项名称',dataIndex: 'configurationName',key: 'configurationName',},{title: '配置项值',dataIndex: 'configurationValue',key: 'configurationValue',},{title: '单位',dataIndex: 'unit',key: 'unit',},{title: '配置项描述',dataIndex: 'remark',key: 'remark',}]) \n" +
        "const total = ref(0) //分页参数 \n"+
        "const pageNo = ref(1) \n"+
        "const pageSize = ref(10) \n" +
        "const refreshData = ()=>{ \n" +
        "   const tmpParams ={classificationCode:classificationCode.value,configurationName:configurationName.value,pageNo:pageNo.value,pageSize:pageSize.value} \n" +
        "   spinning.value = true \n" +
        "   defHttp.get({url:'/configuration/list',params:tmpParams}).then(res =>{ \n" +
        "       spinning.value = false \n" +
        "       total.value = res?.total || 0 \n" +
        "       tableData.value = res?.records || [] \n" +
        "   }) \n" +
        "} \n" +
        "const onShowSizeChange = (current: number, pSize: number) => { \n" +
        "   pageNo.value = current; \n" +
        "   pageSize.value = pSize; \n" +
        "   total.value = 0; \n" +
        "   refreshData(); \n" +
        "} \n" +            
        "const initPageAndRefreshData = ()=>{ \n" +
        "   pageNo.value = 1; \n" +
        "   pageSize.value = 10; \n" +
        "   total.value = 0; \n" +
        "   refreshData(); \n" +
        "} \n" +
        "const updateData = (record,index)=>{ \n" +
        "   defHttp.post({url:'/configuration/edit',data:record}).then(res =>{    \n" +
        "       initPageAndRefreshData() \n" +
        "   }) \n" +
        "} \n" +
        "onMounted(() => { \n" +
        "   refreshData() \n" +
        "}) \n" +
        "</script> \n"+
        "<style scoped> \n"+
        ".panel-root-dom{ \n" +
        "   width: 100%; \n" +
        "   height: 100%; \n" +
        "   box-sizing: border-box; \n" +
        "   background-color: #f5f5f5; \n" +
        "} \n" +
        ".panel-body-content{ \n" +
        "   width: 100%; \n" +
        "   height: 100%; \n" +
        "   box-sizing: border-box; \n" +
        "   background-color: #fff; \n" +
        "   padding: 10px; \n" +
        "} \n" +
        ".panel-header{ \n" +
        "   width: 100%; \n" +
        "   height: 60px; \n" +
        "   box-sizing: border-box; \n" +
        "   padding:8px; \n" +
        "} \n" +
        ".panel-body{ \n" +
        "   width: 100%; \n" +
        "   height: calc(100% - 100px); \n" +
        "   box-sizing: border-box; \n" +
        "} \n" +
        ".panel-bottom{ \n" +
        "   width: 100%; \n" +
        "   height: 40px; \n" +
        "   box-sizing: border-box; \n" +
        "} \n" +
        "</style> \n" +
        "} \n"
        }
        export { getFrontCodeStr }